import request from './request'

// 添加酒店评论
export function addHotelReview(data: {
  hotelId: string;
  rating: number;
  comment: string;
}) {
  return request({
    url: '/reviews',
    method: 'post',
    data
  })
}

// 获取酒店评论列表
export function getHotelReviews(hotelId: string, params?: { page?: number; limit?: number }) {
  return request({
    url: `/hotels/${hotelId}/reviews`,
    method: 'get',
    params
  })
}

// 获取用户的所有评论
export function getUserReviews() {
  return request({
    url: '/reviews/user',
    method: 'get'
  })
}

// 删除评论
export function deleteReview(id: string) {
  return request({
    url: `/reviews/${id}`,
    method: 'delete'
  })
}

// 更新评论
export function updateReview(id: string, data: { rating?: number; comment?: string }) {
  return request({
    url: `/reviews/${id}`,
    method: 'put',
    data
  })
} 